Skip to content

Feather/linesplit and line continue#102

Open
superiums wants to merge 2 commits intoadam-mcdaniel:mainfrom
superiums:feather/linesplit
Open

Feather/linesplit and line continue#102
superiums wants to merge 2 commits intoadam-mcdaniel:mainfrom
superiums:feather/linesplit

Conversation

@superiums
Copy link

  • optional choose ; or linebreak to split a statement. linebreak was automaticlly analyzied when a new line start. but except a new lined followed these chars:
    '{' | '(' | '[' | ',' | '>' | '=' | ';' | '\n' | '\\'
  • added \ to the end of a line to contiue a line.

tested with following cases:

# ζ΅‹θ―•1: ηΊ―ζ’θ‘Œη¬¦εˆ†ε‰²
let a = 1
let b = a + 2
echo b
echo "1 pass"

# ζ΅‹θ―•2: εˆ†ε·η»“ε°Ύ
let c = 3; let d = c * 4;
echo d
echo "2 pass"

# ζ΅‹θ―•3: ζ··εˆεˆ†ε‰²
let e = 5;
let f = e + 6  # ζ— εˆ†ε·
let g = f // 7;
echo g
echo "3 pass"

# ζ΅‹θ―•4: ζŽ§εˆΆη»“ζž„θ‡ͺ动终歒
if g > 0 {
    echo "Positive"
}

echo "pass 4"

let sum =0
for i in 0 to 10 {
    echo i
    let sum = sum + i
}
echo sum
echo "pass 5"

# ζ΅‹θ―•5: ε€šθ‘Œε­—η¬¦δΈ²
let logo = "
    β–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
    β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•
    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  
    β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•  
    β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
    β•šβ•β•  β•šβ•β•β•šβ•β•β•β•β•β•β•
"
echo logo
echo "pass 6"

# ζ΅‹θ―•6: 续葌符连ζŽ₯
let long_expr = 1 + 2 + \
                3 + 4 + \
                5
echo long_expr                

echo "pass all"
# ζ΅‹θ―•7: ζ–‡δ»Άζœ«ε°Ύθ£…ι₯°ζ’葌符

@adam-mcdaniel
Copy link
Owner

I'll take a look in the morning!! Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants